package viethp.mtrade.activities;

import viethp.mtrade.customactivities.ATabWantGroup;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;

public class AWantGroupEXP extends Activity implements OnClickListener{
Button next, back;
	
	public void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
		setContentView(R.layout.a_want_group_expiration);
		
		init();
		setListener();
		showKeyboard();
	}
	
//	public void onResume(){
//		super.onResume();
//		showKeyboard();
//	}
	public void showKeyboard(){
		InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
		imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0);
	}
	
	public void init(){
		next = (Button) findViewById(R.id.btnnext);
		back = (Button) findViewById(R.id.btnback);
	}
	
	public void setListener(){
		next.setOnClickListener(this);
		back.setOnClickListener(this);
	}

	public void onClick(View v) {
		switch(v.getId()){
		case R.id.btnnext:
			View view = ATabWantGroup.group
            .getLocalActivityManager()
            .startActivity(
                    "AWantGroupPhoto",
                    new Intent(v.getContext(), AWantGroupPhoto.class)
                            .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP))
            .getDecorView();
			ATabWantGroup.group.replaceView(view);
			break;
		case R.id.btnback:
			ATabWantGroup.group.back();
	}
		
	}
}
